﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MongoServices
{
	/// <summary>
	/// Extensions to the IEnumerable&lt;&gt; interface.
	/// </summary>
	internal static class IEnumerableExtensions
	{
		#region Public Static Methods
		/// <summary>
		/// Provides ForEach for any generic IEnumberable object.
		/// </summary>
		/// <typeparam name="T">Any object type.</typeparam>
		/// <param name="objects">The objects to process.</param>
		/// <param name="action">The action to perform.</param>
		public static void ForEach<T>(this IEnumerable<T> objects, Action<T> action)
		{
			foreach (var obj in objects)
			{
				action(obj);
			}
		}
		#endregion
	}
}
